<template>
    <div id="app">
        <router-view />
    </div>
</template>

<script>
    import { ipcRenderer } from "electron";
    export default {
        name: 'App',
        created() {
            ipcRenderer.on("message", (event, text) => {
                console.log(arguments);
                this.tips = text;
            });
            ipcRenderer.on("downloadProgress", (event, progressObj)=> {
                console.log(progressObj);
                this.downloadPercent = progressObj.percent || 0;
            });
            ipcRenderer.on("isUpdateNow", () => {
                ipcRenderer.send("isUpdateNow");
            });
        },
        beforeDestroy() {
            ipcRenderer.removeAll(["message", "downloadProgress", "isUpdateNow"]);//remove只能移除单个事件，单独封装removeAll移除所有事件
        }
    }
</script>

<style>
    body {
        margin: 0;
    }
    #app {
        height: 100vh;
    }

</style>
